package org.example.controller;

import org.example.domain.ResponseResult;
import org.example.domain.Users;
import org.example.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author beikbei
 * @version 1.0
 * @description: TODO
 * @date 2024/5/11 17:46
 */
@RestController
public class LoginController {

    @Autowired
    private LoginService loginService;

    @PostMapping("/user/login")
    public ResponseResult login(@RequestBody Users user) {
        return loginService.login(user);
    }
    @RequestMapping("/user/logout")
    public ResponseResult logout() {return loginService.logout();}
}
